﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace nbb.darbo_grafikas
{
    public partial class FormSelectTask : Form
    {
        Dictionary<Program.Operation, string> tasks;

        public FormSelectTask()
        {
            InitializeComponent();
            tasks = new Dictionary<Program.Operation, string>();
            tasks.Add(Program.Operation.kuriamas_naujas, "kurti naują grafiką");
            tasks.Add(Program.Operation.redaguojamas_senas, "atidaryti jau sukurtą grafiką");
            List<KeyValuePair<Program.Operation, string>> taskList = tasks.ToList<KeyValuePair<Program.Operation, string>>();
            cmbTasks.DataSource = taskList;
            cmbTasks.DisplayMember = "Value";
            cmbTasks.ValueMember = "Key";
            cmbTasks.SelectedIndex = -1;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            Program.ImDoingNow = (Program.Operation)cmbTasks.SelectedValue;
            switch (Program.ImDoingNow)
            {
                case Program.Operation.kuriamas_naujas:
                    this.Visible = false;
                    using (FormSelectDates fsm = new FormSelectDates())
                    {
                        fsm.ShowDialog();
                    }
                    break;
                case Program.Operation.redaguojamas_senas:
                    this.Visible = false;
                    using (FormSelectSchedule fss = new FormSelectSchedule())
                    {
                        fss.ShowDialog();
                    }
                    break;
                default:
                    return;
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {

        }
    }
}
